﻿<controlli:BaseCusControl  x:Class="DocManagerControls.Controls.DocumentiControl"
             xmlns:controlli="clr-namespace:DocManagerControls.Controls"
             xmlns:convert="clr-namespace:DocManagerControls.Converters"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             AllowDrop="True" HorizontalContentAlignment="Left"
             HorizontalAlignment="Left" VerticalAlignment="Top"              
             Background="YellowGreen" JournalEntry.Name="Gestione documenti"              
             mc:Ignorable="d" Width="Auto" Height="670">

    <TabControl Height="Auto" Width="Auto"  Name="tabControl1">
        <TabItem Header="Carica doc." Name="tabItem1">

            <Grid Name="grid1" AllowDrop="True"  Width="Auto" Margin="0,0,0,0" PreviewDragOver="txtDocPath_PreviewDragOver" PreviewDragEnter="txtDocPath_PreviewDragEnter"  PreviewDrop="Grid_PreviewDrop" 
          DragOver="grid1_DragOver"  DragEnter="txtDocPath_DragEnter">
                <Rectangle Height="62" HorizontalAlignment="Left" Margin="10,10,10,0" Name="rectangle1" Stroke="#FF59EFCC" VerticalAlignment="Top" Width="438" 
                   Fill="#FF61AEDE" />

                <TextBox Height="32"  HorizontalAlignment="Left" Margin="14,14,0,0" Name="txtDocPath" VerticalAlignment="Top" Width="430" IsReadOnly="True" AcceptsTab="True" TextWrapping="Wrap" Style="{DynamicResource TextBoxSelStyle}" />
                <TextBlock  Height="23"  HorizontalAlignment="Left" Margin="11,50,0,0" Name="textBlock1" Text="&lt; Trascina quì un documento >" VerticalAlignment="Top" Width="196" />

                <Label  Content="Gruppo con permessi modifica" Margin="13,367,0,0" Style="{StaticResource LabelIntestaStyle2}" />
                <TextBox Height="24" HorizontalAlignment="Left" Margin="13,284,0,0" Name="txtTagsPersonalizzati" VerticalAlignment="Top" Width="430" />
                <Label  Style="{StaticResource LabelIntestaStyle2}" Content="Tags personalizzati" Margin="13,261,0,0" Name="label2"  />

                <CheckBox Content="Consenti modifica" Height="20" HorizontalAlignment="Left" Margin="13,79,0,0" Name="checkBoxModifica" VerticalAlignment="Top" />
                <CheckBox Content="Vedi" Height="20" HorizontalAlignment="Left" Margin="197,50,0,0" Name="checkBoxVedi" VerticalAlignment="Top"  />
                <CheckBox Content="Comprimi" IsChecked="True" Height="20" HorizontalAlignment="Left" Margin="197,79,0,0" Name="checkComprimi" VerticalAlignment="Top"  />

                <ComboBox Height="24" HorizontalAlignment="Left" Margin="13,390,0,0" Name="comboRuoliModifica" VerticalAlignment="Top" Width="430" />
                <Label Content="Tags predefiniti"  Style="{StaticResource LabelIntestaStyle2}"  Margin="14,210,0,0" Name="label4" />
                <ComboBox Height="24" HorizontalAlignment="Left" Margin="11,128,0,0" Name="comboCategorie" VerticalAlignment="Top" Width="430" SelectionChanged="comboCategorie_SelectionChanged" />
                <Label  Style="{StaticResource LabelIntestaStyle2}"  Margin="12,105,0,0" Name="label3" Content="Categoria" />


                <ComboBox Height="24" HorizontalAlignment="Left" Margin="13,337,0,0" Name="comboRuoliVisibilità" VerticalAlignment="Top" Width="430" />
                <Label Content="Gruppo con permessi visibilità"  Style="{StaticResource LabelIntestaStyle2}" Margin="13,314,0,0" Name="label5"  />
                <ComboBox Height="24" HorizontalAlignment="Left" Margin="12,180,0,0" Name="comboSottoCategorie" VerticalAlignment="Top" Width="430" />
                <Label  Style="{StaticResource LabelIntestaStyle2}" Content="SottoCategoria" Margin="13,157,0,0" Name="label6" />
                <ComboBox Height="24" HorizontalAlignment="Left" Margin="13,232,0,0" Name="comboTagsPredefiniti" VerticalAlignment="Top" Width="430" />
                <TextBox Height="64" HorizontalAlignment="Left" Margin="13,450,0,0" Name="txtNote" VerticalAlignment="Top" Width="430"  AcceptsReturn="True"/>
                <Label Content="Note"  Style="{StaticResource LabelIntestaStyle2}" Margin="14,426,0,0" Name="label7"  />

                <Button Content="Carica"  Style="{StaticResource OrangeButton}" Margin="37,532,0,98"  Name="btnCarica" HorizontalAlignment="Left"
                   Click="btnCarica_Click" />
                <Button  Content="Vedi doc."  Style="{StaticResource OrangeButton}" Margin="197,532,0,98" Name="button1"  HorizontalAlignment="Left"/>

                <Label  Width="Auto" Margin="1,568,0,66" Height="26" Name="lblMessaggi" FontWeight="Bold" Foreground="Red" />
                <CheckBox Content="Cripta" Height="20" HorizontalAlignment="Left" IsChecked="True" Margin="136,79,0,0" Name="checkCripta" VerticalAlignment="Top" />

            </Grid>
            
        </TabItem>

        <TabItem Header="Cerca doc." Name="tabItem2">

            <StackPanel Orientation="Horizontal">
                <Grid Name="grid_2" AllowDrop="True" Height="Auto" HorizontalAlignment="Left"  >

                    <Rectangle Height="62" Margin="5" Name="rectangle_2" Stroke="#FF59EFCC" VerticalAlignment="Top" Width="435" Fill="#FF61AEDE" />

                    <TextBox x:Name="txtNomeDoc" Height="32"  HorizontalAlignment="Left" Margin="12,34,0,0" VerticalAlignment="Top" 
                 Width="420" IsReadOnly="False" AcceptsReturn="True" PreviewKeyDown="txtNomeDoc_PreviewKeyDown" AcceptsTab="False" TabIndex="2" />
                    <Label Height="25" HorizontalAlignment="Left" Margin="10,394,0,0" Name="lblMessaggiRicerche" VerticalAlignment="Top" Width="429" />
                    <ComboBox Height="20" HorizontalAlignment="Left" Margin="12,106,0,0" Name="comboCategorieRicerche" VerticalAlignment="Top" Width="430" SelectionChanged="comboCategorieRicerche_SelectionChanged" TabIndex="4" />
                    <Label FontWeight="Normal" Foreground="#FF041332" Height="26" HorizontalAlignment="Left" IsEnabled="False" Margin="13,80,0,0" Name="label_3" VerticalAlignment="Top" Width="62" Content="Categoria" />
                    <!---->
           <Button Content="Cerca" Height="26" HorizontalAlignment="Left" Margin="22,362,0,0" Name="btnCerca" VerticalAlignment="Top" Width="103" Click="btnCerca_Click" BorderBrush="#FF074B3C">
            <Button.Background>
                <RadialGradientBrush>
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FFDDD40C" Offset="0.617" />
                    <GradientStop Color="#FF18AD74" Offset="0.074" />
                </RadialGradientBrush>
            </Button.Background>
        </Button>
        
        <Button BorderBrush="#FF074B3C" Content="Vedi doc." Height="26" HorizontalAlignment="Left" Margin="145,362,0,0" Name="btnVediDoc" 
                VerticalAlignment="Top" Width="103" Click="btnVediDoc_Click">
            <Button.Background>
                <RadialGradientBrush>
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FFDDD40C" Offset="0.617" />
                    <GradientStop Color="#FF18AD74" Offset="0.074" />
                </RadialGradientBrush>
            </Button.Background>
        </Button>
        
        <ComboBox Height="20" HorizontalAlignment="Left" Margin="13,158,0,0" Name="comboSottoCategorieRicerche" VerticalAlignment="Top" Width="430"  TabIndex="5"/>
                    <Label Content="SottoCategoria" FontWeight="Normal" Foreground="#FF041332" Height="26" HorizontalAlignment="Left" IsEnabled="False" Margin="14,132,0,0" Name="label_6" VerticalAlignment="Top" Width="88" />
        <Label Content="Nome del file \ documento" FontWeight="Normal" Foreground="#FF041332" Height="26" HorizontalAlignment="Left" IsEnabled="False" Margin="10,10,0,0" Name="label_4" VerticalAlignment="Top" Width="303" />
        <Expander Header="Altre ricerche" Height="140" HorizontalAlignment="Left" Margin="14,199,0,0" Name="expander1" VerticalAlignment="Top" Width="428">
            <StackPanel>
                <Label Content="Tags predefiniti" FontWeight="Normal" Foreground="#FF041332" Height="29" HorizontalAlignment="Left" IsEnabled="False" Margin="0" Name="label1" VerticalAlignment="Top" Width="89" />
                <ComboBox Height="20" HorizontalAlignment="Left" Margin="0" Name="comboTagsPredefinitiRicerche" VerticalAlignment="Top" Width="410" />
                <Label Content="Tags personalizzati" Margin="0" FontWeight="Normal" Foreground="#FF041332" Height="29" HorizontalAlignment="Left" IsEnabled="False"  Name="label_2" VerticalAlignment="Top" Width="105" />
                <TextBox Height="20" HorizontalAlignment="Left" Margin="0" Name="txtTagsPersonalizzatiRicerche" VerticalAlignment="Top" Width="410" />

            </StackPanel>
        </Expander><CheckBox Content="Cerca per ID" Height="19" HorizontalAlignment="Left" Margin="165,72,0,0" Name="checkBoxIsID" VerticalAlignment="Top" Width="83"  TabIndex="3"/>
     </Grid>
                <Grid>
            
         <!-- parte destra list e paginatore -->
                    <StackPanel>

                        <ListView x:Name="listDocs" MinHeight="400" HorizontalAlignment="Left" Margin="1"  VerticalAlignment="Top" MinWidth="300"
              Background="AliceBlue"  ListBoxItem.Selected="listDocs_Selected" MouseDoubleClick="listDocs_MouseDoubleClick"
                  ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <ListView.Resources>
                <convert:ConverterExtToImage x:Key="converterExtToImage" />
            </ListView.Resources>
            <ListView.ContextMenu>
                 <ContextMenu Name="contMenu" StaysOpen="true" Background="Cornsilk" MenuItem.Click="contMenu_Click"  >
                    <ContextMenu.BitmapEffect>
                        <OuterGlowBitmapEffect />
                    </ContextMenu.BitmapEffect>
                     
                     <MenuItem Header="Vedi" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\Read.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                     
                     <MenuItem Header="Download" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\downlMedia.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                     
                    <MenuItem Header="Modifica" Margin="2" >
                        <MenuItem.Icon>
                            <Image Source="..\IMG\modMedia.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                    
                      <MenuItem Header="Notifica" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\notificaPicc.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                      <MenuItem Header="Email" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\email.jpg"/>
                        </MenuItem.Icon>
                    </MenuItem>
                      <MenuItem Header="Avvia iter" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\iterPicc.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Delete" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\delMedia.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                </ContextMenu>
            </ListView.ContextMenu>
            <ListView.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal" >
                    <Image x:Name="imgDoc" Width="16" Height="16" Stretch="UniformToFill"  Source="{Binding Ext, Converter={StaticResource converterExtToImage}}"  Tag="{Binding ID}" Margin="2"></Image>
                    <TextBlock Text="{Binding FileName}" Width="250" VerticalAlignment="Center" />                   
                 </StackPanel>
            </DataTemplate>
            </ListView.ItemTemplate>    
        </ListView>
            <!-- -->
                        <controlli:PaginatorControl x:Name="myPaginator" QuantielementiPerpagina="14" />
                        
                    </StackPanel>

                    <!--<ListView.Resources>
        <local:SexToColorConverter x:Key="SexConverter" />
        <Style TargetType="{x:Type ListViewItem}">
            <Setter Property="Background"
                    Value="{Binding Path=Sex, Converter={StaticResource SexConverter}}" />
        </Style>
    </ListView.Resources>-->

                </Grid>
            </StackPanel>

        </TabItem>    
    </TabControl>
</controlli:BaseCusControl >
